package com.matrix.nickel.mqttlistener;

import org.dromara.mica.mqtt.spring.server.event.MqttClientOfflineEvent;
import org.dromara.mica.mqtt.spring.server.event.MqttClientOnlineEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

/**
 * @author Nickel
 * @since 2025-02-14 23:18:42
 */
@Service
public class MqttConnectStatusListener {
    private static final Logger logger = LoggerFactory.getLogger(MqttConnectStatusListener.class);

    @EventListener
    public void online(MqttClientOnlineEvent event) {
        logger.info("MqttClientOnlineEvent:{}", event);
    }

    @EventListener
    public void offline(MqttClientOfflineEvent event) {
        logger.info("MqttClientOfflineEvent:{}", event);
    }

}